print("访客".center(15))
while 1:
    select = input("回车键继续,'q'退出".center(15))
    if select == 'q':
        break
    else:
        name = input("请输入访客姓名:")
        with open("guest.txt","a+",encoding='utf-8') as f:
            f.write(name+"\n")
            f.close()
print("访客列表".center(15))
with open("guest.txt","r+",encoding='utf-8') as f:
    for i in f:
        print(i.center(15))